package com.alison.config;

import com.alison.YamlMapSourceFactory;
import lombok.Data;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * @author wayne
 * @version Database,  2020/1/29 10:20 下午
 */
@Data
@ToString
//@Configuration
//@EnableConfigurationProperties(value = {Database.class})
@ConfigurationProperties(prefix = "database")
@PropertySource(name = "database.yaml", value = "classpath:database.yaml", encoding = "UTF-8", factory = YamlMapSourceFactory.class)
//@PropertySource(value = "classpath:database.properties")
public class Database {
    String url;
    String username;
    String password;
}
